<!DOCTYPE html>
<html>

<head>
  <title>Quarkus - MicroProfile Health</title>
  <script id="adobe_dtm" src="https://www.redhat.com/dtm.js" type="text/javascript"></script>
  <script src="/assets/javascript/highlight.pack.js" type="text/javascript"></script>
  <META HTTP-EQUIV='Content-Security-Policy' CONTENT="default-src 'none'; script-src 'self' 'unsafe-eval' 'sha256-ANpuoVzuSex6VhqpYgsG25OHWVA1I+F6aGU04LoI+5s=' 'sha256-ipy9P/3rZZW06mTLAR0EnXvxSNcnfSDPLDuh3kzbB1w=' js.bizographics.com https://www.redhat.com assets.adobedtm.com jsonip.com https://ajax.googleapis.com https://www.googletagmanager.com https://www.google-analytics.com https://use.fontawesome.com; style-src 'self' https://fonts.googleapis.com https://use.fontawesome.com; img-src 'self' *; media-src 'self' ; frame-src https://www.googletagmanager.com https://www.youtube.com; frame-ancestors 'none'; base-uri 'none'; object-src 'none'; form-action 'none'; font-src 'self' https://use.fontawesome.com https://fonts.gstatic.com;">
  <META HTTP-EQUIV='X-Frame-Options' CONTENT="DENY">
  <META HTTP-EQUIV='X-XSS-Protection' CONTENT="1; mode=block">
  <META HTTP-EQUIV='X-Content-Type-Options' CONTENT="nosniff">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Quarkus: Supersonic Subatomic Java">
  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:site" content="@QuarkusIO"> 
  <meta name="twitter:creator" content="@QuarkusIO">
  <meta property="og:url" content="https://quarkus.io/guides/microprofile-health" />
  <meta property="og:title" content="Quarkus - MicroProfile Health" />
  <meta property="og:description" content="Quarkus: Supersonic Subatomic Java" />
  <meta property="og:image" content="/assets/images/quarkus_card.png" />
  <link rel="canonical" href="https://quarkus.io/guides/microprofile-health">
  <link rel="shortcut icon" type="image/png" href="/favicon.ico" >
  <link rel="stylesheet" href="https://quarkus.io/guides/stylesheet/config.css" />
  <link rel="stylesheet" href="/assets/css/main.css" />
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css" integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
  <link rel="alternate" type="application/rss+xml"  href="https://quarkus.io/feed.xml" title="Quarkus">
  <script src="https://quarkus.io/assets/javascript/goan.js" type="text/javascript"></script>
  <script src="https://quarkus.io/assets/javascript/hl.js" type="text/javascript"></script>
</head>

<body class="guides">
  <!-- Google Tag Manager (noscript) -->
  <noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NJWS5L"
  height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
  <!-- End Google Tag Manager (noscript) -->

  <div class="nav-wrapper">
  <div class="grid-wrapper">
    <div class="width-12-12">
      <input type="checkbox" id="checkbox" />
      <nav id="main-nav" class="main-nav">
  <div class="container">
    <div class="logo-wrapper">
      
        <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_600px_reverse.png" class="project-logo" title="Quarkus"></a>
      
    </div>
    <label class="nav-toggle" for="checkbox">
      <i class="fa fa-bars"></i>
    </label>
    <div id="menu" class="menu">
      <span>
        <a href="/get-started/" class="">Get Started</a>
      </span>
      <span>
        <a href="/guides/" class="active">Guides</a>
      </span>
      <span>
        <a href="/community/" class="">Community</a>
      </span>
      <span>
        <a href="/support/" class="">Support</a>
      </span>
      <span>
        <a href="/blog/" class="">Blog</a>
      </span>
      <span>
        <a href="https://code.quarkus.io" class="button-cta secondary white">Start Coding</a>
      </span>
    </div>
  </div>
      </nav>
    </div>
  </div>
</div>

  <div class="content">
    <div class="guide">
  <div class="width-12-12">
    <h1 class="text-caps">Quarkus - MicroProfile Health</h1>
    <div class="hide-mobile toc"><ul class="sectlevel1">
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#architecture">Architecture</a></li>
<li><a href="#solution">Solution</a></li>
<li><a href="#creating-the-maven-project">Creating the Maven Project</a></li>
<li><a href="#running-the-health-check">Running the health check</a></li>
<li><a href="#creating-your-first-health-check">Creating your first health check</a></li>
<li><a href="#adding-a-readiness-health-check-procedure">Adding a readiness health check procedure</a></li>
<li><a href="#negative-health-check-procedures">Negative health check procedures</a></li>
<li><a href="#adding-user-specific-data-to-the-health-check-response">Adding user-specific data to the health check response</a></li>
<li><a href="#extension-health-checks">Extension health checks</a></li>
<li><a href="#health-ui">Health UI</a></li>
<li><a href="#conclusion">Conclusion</a></li>
<li><a href="#configuration-reference">Configuration Reference</a></li>
</ul></div>
    <div>
      <div id="preamble">
<div class="sectionbody">
<div class="paragraph">
<p>This guide demonstrates how your Quarkus application can utilize the MicroProfile
Health specification through the SmallRye Health extension.</p>
</div>
<div class="paragraph">
<p>MicroProfile Health allows applications to provide information about their state
to external viewers which is typically useful in cloud environments where automated
processes must be able to determine whether the application should be discarded
or restarted.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="prerequisites"><a class="anchor" href="#prerequisites"></a>Prerequisites</h2>
<div class="sectionbody">
<div class="paragraph">
<p>To complete this guide, you need:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>less than 15 minutes</p>
</li>
<li>
<p>an IDE</p>
</li>
<li>
<p>JDK 1.8+ installed with <code>JAVA_HOME</code> configured appropriately</p>
</li>
<li>
<p>Apache Maven 3.6.2+</p>
</li>
</ul>
</div>
</div>
</div>
<div class="sect1">
<h2 id="architecture"><a class="anchor" href="#architecture"></a>Architecture</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In this guide, we build a simple REST application that exposes MicroProfile Health
functionalities at the <code>/health/live</code> and <code>/health/ready</code> endpoints according to the
specification.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="solution"><a class="anchor" href="#solution"></a>Solution</h2>
<div class="sectionbody">
<div class="paragraph">
<p>We recommend that you follow the instructions in the next sections and create the
application step by step. However, you can go right to the completed example.</p>
</div>
<div class="paragraph">
<p>Clone the Git repository: <code>git clone <a href="https://github.com/quarkusio/quarkus-quickstarts.git" class="bare">https://github.com/quarkusio/quarkus-quickstarts.git</a></code>, or download an
<a href="https://github.com/quarkusio/quarkus-quickstarts/archive/master.zip">archive</a>.</p>
</div>
<div class="paragraph">
<p>The solution is located in the <code>microprofile-health-quickstart</code>
<a href="https://github.com/quarkusio/quarkus-quickstarts/tree/master/microprofile-health-quickstart">directory</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="creating-the-maven-project"><a class="anchor" href="#creating-the-maven-project"></a>Creating the Maven Project</h2>
<div class="sectionbody">
<div class="paragraph">
<p>First, we need a new project. Create a new project with the following command:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code class="language-none hljs">mvn io.quarkus:quarkus-maven-plugin:1.7.0.Final:create \
    -DprojectGroupId=org.acme \
    -DprojectArtifactId=microprofile-health-quickstart \
    -Dextensions="health"
cd microprofile-health-quickstart</code></pre>
</div>
</div>
<div class="paragraph">
<p>This command generates a Maven project, importing the <code>smallrye-health</code> extension
which is an implementation of the MicroProfile Health specification used in Quarkus.</p>
</div>
<div class="paragraph">
<p>If you already have your Quarkus project configured, you can add the <code>smallrye-health</code> extension
to your project by running the following command in your project base directory:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="bash" class="language-bash hljs">./mvnw quarkus:add-extension -Dextensions="smallrye-health"</code></pre>
</div>
</div>
<div class="paragraph">
<p>This will add the following to your <code>pom.xml</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="xml" class="language-xml hljs">&lt;dependency&gt;
    &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
    &lt;artifactId&gt;quarkus-smallrye-health&lt;/artifactId&gt;
&lt;/dependency&gt;</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="running-the-health-check"><a class="anchor" href="#running-the-health-check"></a>Running the health check</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Importing the <code>smallrye-health</code> extension directly exposes three REST endpoints:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>/health/live</code> - The application is up and running.</p>
</li>
<li>
<p><code>/health/ready</code> - The application is ready to serve requests.</p>
</li>
<li>
<p><code>/health</code> - Accumulating all health check procedures in the application.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>To check that the <code>smallrye-health</code> extension is working as expected:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>start your Quarkus application with <code>./mvnw compile quarkus:dev</code></p>
</li>
<li>
<p>access the <code><a href="http://localhost:8080/health/live" class="bare">http://localhost:8080/health/live</a></code> endpoint using your browser or
<code>curl <a href="http://localhost:8080/health/live" class="bare">http://localhost:8080/health/live</a></code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>All of the health REST endpoints return a simple JSON object with two fields:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>status</code>&#8201;&#8212;&#8201;the overall result of all the health check procedures</p>
</li>
<li>
<p><code>checks</code>&#8201;&#8212;&#8201;an array of individual checks</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>The general <code>status</code> of the health check is computed as a logical AND of all the
declared health check procedures. The <code>checks</code> array is empty as we have not specified
any health check procedure yet so let&#8217;s define some.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="creating-your-first-health-check"><a class="anchor" href="#creating-your-first-health-check"></a>Creating your first health check</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In this section, we create our first simple health check procedure.</p>
</div>
<div class="paragraph">
<p>Create the <code>org.acme.microprofile.health.SimpleHealthCheck</code> class:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.microprofile.health;

import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Liveness;

import javax.enterprise.context.ApplicationScoped;

@Liveness
@ApplicationScoped <i class="conum" data-value="1"></i><b>(1)</b> <i class="conum" data-value="2"></i><b>(2)</b>
public class SimpleHealthCheck implements HealthCheck {

    @Override
    public HealthCheckResponse call() {
        return HealthCheckResponse.up("Simple health check");
    }
}</code></pre>
</div>
</div>
<div class="colist arabic">
<table>
<tr>
<td><i class="conum" data-value="1"></i><b>1</b></td>
<td>It&#8217;s recommended to annotate the health check class with <code>@ApplicationScoped</code> or the <code>@Singleton</code> scope so that a single bean instance is used for all health check requests.</td>
</tr>
<tr>
<td><i class="conum" data-value="2"></i><b>2</b></td>
<td>If a bean class annotated with one of the health check annotations declares no scope then the <code>@Singleton</code> scope is used automatically.</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>As you can see, the health check procedures are defined as CDI beans that implement the <code>HealthCheck</code> interface and are annotated with one of the health check qualifiers, such as:</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>@Liveness</code> - the liveness check accessible at <code>/health/live</code></p>
</li>
<li>
<p><code>@Readiness</code> - the readiness check accessible at <code>/health/ready</code></p>
</li>
</ul>
</div>
<div class="paragraph">
<p><code>HealthCheck</code> is a functional interface whose single method <code>call</code> returns a
<code>HealthCheckResponse</code> object which can be easily constructed by the fluent builder
API shown in the example.</p>
</div>
<div class="paragraph">
<p>As we have started our Quarkus application in dev mode simply repeat the request
to <code><a href="http://localhost:8080/health/live" class="bare">http://localhost:8080/health/live</a></code> by refreshing your browser window or by
using <code>curl <a href="http://localhost:8080/health/live" class="bare">http://localhost:8080/health/live</a></code>. Because we defined our health check
to be a liveness procedure (with <code>@Liveness</code> qualifier) the new health check procedure
is now present in the <code>checks</code> array.</p>
</div>
<div class="paragraph">
<p>Congratulations! You&#8217;ve created your first Quarkus health check procedure. Let&#8217;s
continue by exploring what else can be done with the MicroProfile Health specification.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="adding-a-readiness-health-check-procedure"><a class="anchor" href="#adding-a-readiness-health-check-procedure"></a>Adding a readiness health check procedure</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In the previous section, we created a simple liveness health check procedure which states
whether our application is running or not. In this section, we will create a readiness
health check which will be able to state whether our application is able to process
requests.</p>
</div>
<div class="paragraph">
<p>We will create another health check procedure that simulates a connection to
an external service provider such as a database. For starters, we will always return
the response indicating the application is ready.</p>
</div>
<div class="paragraph">
<p>Create <code>org.acme.microprofile.health.DatabaseConnectionHealthCheck</code> class:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.microprofile.health;

import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Readiness;

import javax.enterprise.context.ApplicationScoped;

@Readiness
@ApplicationScoped
public class DatabaseConnectionHealthCheck implements HealthCheck {

    @Override
    public HealthCheckResponse call() {
        return HealthCheckResponse.up("Database connection health check");
    }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>If you now rerun the health check at <code><a href="http://localhost:8080/health/live" class="bare">http://localhost:8080/health/live</a></code> the <code>checks</code>
array will contain only the previously defined <code>SimpleHealthCheck</code> as it is the only
check defined with the <code>@Liveness</code> qualifier. However, if you access
<code><a href="http://localhost:8080/health/ready" class="bare">http://localhost:8080/health/ready</a></code> (in the browser or with
<code>curl <a href="http://localhost:8080/health/ready" class="bare">http://localhost:8080/health/ready</a></code>) you will see only the
<code>Database connection health check</code> as it is the only health check defined with the
<code>@Readiness</code> qualifier as the readiness health check procedure.</p>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
If you access <code><a href="http://localhost:8080/health" class="bare">http://localhost:8080/health</a></code> you will get back both checks.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>More information about which health check procedures should be used in which situation
is detailed in the MicroProfile Health specification. Generally, the liveness
procedures determine whether the application should be restarted while readiness
procedures determine whether it makes sense to contact the application with requests.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="negative-health-check-procedures"><a class="anchor" href="#negative-health-check-procedures"></a>Negative health check procedures</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In this section, we extend our <code>Database connection health check</code> with the option of
stating that our application is not ready to process requests as the underlying
database connection cannot be established. For simplicity reasons, we only determine
whether the database is accessible or not by a configuration property.</p>
</div>
<div class="paragraph">
<p>Update the <code>org.acme.microprofile.health.DatabaseConnectionHealthCheck</code> class:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.microprofile.health;

import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.HealthCheckResponseBuilder;
import org.eclipse.microprofile.health.Readiness;

import javax.enterprise.context.ApplicationScoped;

@Readiness
@ApplicationScoped
public class DatabaseConnectionHealthCheck implements HealthCheck {

    @ConfigProperty(name = "database.up", defaultValue = "false")
    private boolean databaseUp;

    @Override
    public HealthCheckResponse call() {

        HealthCheckResponseBuilder responseBuilder = HealthCheckResponse.named("Database connection health check");

        try {
            simulateDatabaseConnectionVerification();
            responseBuilder.up();
        } catch (IllegalStateException e) {
            // cannot access the database
            responseBuilder.down();
        }

        return responseBuilder.build();
    }

    private void simulateDatabaseConnectionVerification() {
        if (!databaseUp) {
            throw new IllegalStateException("Cannot contact database");
        }
    }
}</code></pre>
</div>
</div>
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Until now we used a simplified method of building a <code>HealthCheckResponse</code>
through the <code>HealthCheckResponse#up(String)</code> (there is also
<code>HealthCheckResponse#down(String)</code>) which will directly build the response object.
From now on, we utilize the full builder capabilities provided by the
<code>HealthCheckResponseBuilder</code> class.
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p>If you now rerun the readiness health check (at <code><a href="http://localhost:8080/health/ready" class="bare">http://localhost:8080/health/ready</a></code>)
the overall <code>status</code> should be DOWN. You can also check the liveness check at
<code><a href="http://localhost:8080/health/live" class="bare">http://localhost:8080/health/live</a></code> which will return the overall <code>status</code> UP because
it isn&#8217;t influenced by the readiness checks.</p>
</div>
<div class="paragraph">
<p>As we shouldn&#8217;t leave this application with a readiness check in a DOWN state and
because we are running Quarkus in dev mode you can add <code>database.up=true</code> in
<code>src/main/resources/application.properties</code> and rerun the readiness health check again&#8201;&#8212;&#8201;it should be up again.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="adding-user-specific-data-to-the-health-check-response"><a class="anchor" href="#adding-user-specific-data-to-the-health-check-response"></a>Adding user-specific data to the health check response</h2>
<div class="sectionbody">
<div class="paragraph">
<p>In previous sections, we saw how to create simple health checks with only the minimal
attributes, namely, the health check name and its status (UP or DOWN). However, the
MicroProfile specification also provides a way for the applications to supply
arbitrary data in the form of key-value pairs sent to the consuming end. This can be
done by using the <code>withData(key, value)</code> method of the health check response
builder API.</p>
</div>
<div class="paragraph">
<p>Let&#8217;s create a new health check procedure <code>org.acme.microprofile.health.DataHealthCheck</code>:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">package org.acme.microprofile.health;

import org.eclipse.microprofile.health.Liveness;
import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;

import javax.enterprise.context.ApplicationScoped;

@Liveness
@ApplicationScoped
public class DataHealthCheck implements HealthCheck {

    @Override
    public HealthCheckResponse call() {
        return HealthCheckResponse.named("Health check with data")
                .up()
                .withData("foo", "fooValue")
                .withData("bar", "barValue")
                .build();
    }
}</code></pre>
</div>
</div>
<div class="paragraph">
<p>If you rerun the liveness health check procedure by accessing the <code>/health/live</code>
endpoint you can see that the new health check <code>Health check with data</code> is present
in the <code>checks</code> array. This check contains a new attribute called <code>data</code> which is a
JSON object consisting of the properties we have defined in our health check procedure.</p>
</div>
<div class="paragraph">
<p>This functionality is specifically useful in failure scenarios where you can pass the
error along with the health check response.</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="highlightjs highlight"><code data-lang="java" class="language-java hljs">        try {
            simulateDatabaseConnectionVerification();
            responseBuilder.up();
        } catch (IllegalStateException e) {
            // cannot access the database
            responseBuilder.down()
                    .withData("error", e.getMessage()); // pass the exception message
        }</code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="extension-health-checks"><a class="anchor" href="#extension-health-checks"></a>Extension health checks</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Some extension may provide default health checks, including the extension will automatically register its health checks.</p>
</div>
<div class="paragraph">
<p>For example, <code>quarkus-agroal</code> that is used to manage Quarkus datasource(s) automatically register a readiness health check
that will validate each datasources: <a href="datasource#datasource-health-check">Datasource Health Check</a>.</p>
</div>
<div class="paragraph">
<p>You can disable extension health check via the property <code>quarkus.health.extensions.enabled</code> so none will be automatically registered.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="health-ui"><a class="anchor" href="#health-ui"></a>Health UI</h2>
<div class="sectionbody">
<div class="admonitionblock note">
<table>
<tr>
<td class="icon">
<i class="fa icon-note" title="Note"></i>
</td>
<td class="content">
Experimental - not included in the MicroProfile specification
</td>
</tr>
</table>
</div>
<div class="paragraph">
<p><code>health-ui</code> allows you to see your Health Checks in a Web GUI.</p>
</div>
<div class="paragraph">
<p>The Quarkus <code>smallrye-health</code> extension ships with <code>health-ui</code> and enables it by default in dev and test modes, but it can also be explicitly configured for production mode as well.</p>
</div>
<div class="paragraph">
<p><code>health-ui</code> can be accessed from <a href="http://localhost:8080/health-ui/" class="bare">http://localhost:8080/health-ui/</a> .</p>
</div>
<div class="paragraph">
<p><span class="image"><img src="/guides/images/health-ui-screenshot01.png" alt="Health UI"></span></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="conclusion"><a class="anchor" href="#conclusion"></a>Conclusion</h2>
<div class="sectionbody">
<div class="paragraph">
<p>MicroProfile Health provides a way for your application to distribute information
about its healthiness state to state whether or not it is able to function properly.
Liveness checks are utilized to tell whether the application should be restarted and
readiness checks are used to tell whether the application is able to process requests.</p>
</div>
<div class="paragraph">
<p>All that is needed to enable the MicroProfile Health features in Quarkus is:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>adding the <code>smallrye-health</code> Quarkus extension to your project using the
<code>quarkus-maven-plugin</code>:<br></p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre>./mvnw quarkus:add-extension -Dextensions="health"</pre>
</div>
</div>
<div class="ulist">
<ul>
<li>
<p>or simply adding the following Maven dependency:<br></p>
</li>
</ul>
</div>
<div class="listingblock">
<div class="content">
<pre>&lt;dependency&gt;
    &lt;groupId&gt;io.quarkus&lt;/groupId&gt;
    &lt;artifactId&gt;quarkus-smallrye-health&lt;/artifactId&gt;
&lt;/dependency&gt;</pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="configuration-reference"><a class="anchor" href="#configuration-reference"></a>Configuration Reference</h2>
<div class="sectionbody">
<div class="paragraph configuration-legend">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> Configuration property fixed at build time - All other configuration properties are overridable at runtime</p>
</div>
<table class="tableblock frame-all grid-all stretch configuration-reference searchable">
<colgroup>
<col style="width: 80%;">
<col style="width: 10%;">
<col style="width: 10%;">
</colgroup>
<tbody>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-smallrye-health_configuration"></a><a href="#quarkus-smallrye-health_configuration">Configuration property</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-smallrye-health_quarkus.health.extensions.enabled"></a><code><a href="#quarkus-smallrye-health_quarkus.health.extensions.enabled">quarkus.health.extensions.enabled</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Whether or not extensions published health check should be enabled.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-smallrye-health_quarkus.smallrye-health.root-path"></a><code><a href="#quarkus-smallrye-health_quarkus.smallrye-health.root-path">quarkus.smallrye-health.root-path</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Root path for health-checking endpoints.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>/health</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-smallrye-health_quarkus.smallrye-health.liveness-path"></a><code><a href="#quarkus-smallrye-health_quarkus.smallrye-health.liveness-path">quarkus.smallrye-health.liveness-path</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The relative path of the liveness health-checking endpoint.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>/live</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-smallrye-health_quarkus.smallrye-health.readiness-path"></a><code><a href="#quarkus-smallrye-health_quarkus.smallrye-health.readiness-path">quarkus.smallrye-health.readiness-path</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The relative path of the readiness health-checking endpoint.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>/ready</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-smallrye-health_quarkus.smallrye-health.group-path"></a><code><a href="#quarkus-smallrye-health_quarkus.smallrye-health.group-path">quarkus.smallrye-health.group-path</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The relative path of the health group endpoint.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>/group</code></p></td>
</tr>
<tr>
<th class="tableblock halign-left valign-top"><p class="tableblock"><a id="quarkus-smallrye-health_quarkus.smallrye-health.ui"></a><a href="#quarkus-smallrye-health_quarkus.smallrye-health.ui">UI configuration</a></p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Type</p></th>
<th class="tableblock halign-left valign-middle"><p class="tableblock">Default</p></th>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-smallrye-health_quarkus.smallrye-health.ui.root-path"></a><code><a href="#quarkus-smallrye-health_quarkus.smallrye-health.ui.root-path">quarkus.smallrye-health.ui.root-path</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>The path where Health UI is available. The value <code>/</code> is not allowed as it blocks the application from serving anything else.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">string</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>/health-ui</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-smallrye-health_quarkus.smallrye-health.ui.always-include"></a><code><a href="#quarkus-smallrye-health_quarkus.smallrye-health.ui.always-include">quarkus.smallrye-health.ui.always-include</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>Always include the UI. By default this will only be included in dev and test. Setting this to true will also include the UI in Prod</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>false</code></p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><span class="icon"><i class="fa fa-lock" title="Fixed at build time"></i></span> <a id="quarkus-smallrye-health_quarkus.smallrye-health.ui.enable"></a><code><a href="#quarkus-smallrye-health_quarkus.smallrye-health.ui.enable">quarkus.smallrye-health.ui.enable</a></code></p>
</div>
<div class="openblock description">
<div class="content">
<div class="paragraph">
<p>If Health UI should be enabled. By default, Health UI is enabled.</p>
</div>
</div>
</div></div></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock">boolean</p></td>
<td class="tableblock halign-left valign-middle"><p class="tableblock"><code>true</code></p></td>
</tr>
</tbody>
</table>
</div>
</div>
    </div>
  </div>
</div>

  </div>

  <div class="content project-footer">
  <div class="footer-section">
    <div class="logo-wrapper">
      <a href="/"><img src="/assets/images/quarkus_logo_horizontal_rgb_reverse.svg" class="project-logo" title="Quarkus"></a>
    </div>
  </div>
  <div class="grid-wrapper">
    <p class="grid__item width-3-12">Quarkus is open. All dependencies of this project are available under the <a href='https://www.apache.org/licenses/LICENSE-2.0' target='_blank'>Apache Software License 2.0</a> or compatible license.<br /><br />This website was built with <a href='https://jekyllrb.com/' target='_blank'>Jekyll</a>, is hosted on <a href='https://pages.github.com/' target='_blank'>Github Pages</a> and is completely open source. If you want to make it better, <a href='https://github.com/quarkusio/quarkusio.github.io' target='_blank'>fork the website</a> and show us what you’ve got.</p>

    
      <div class="width-1-12 project-links">
        <span>Navigation</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="/">Home</a></li>
          
            <li><a href="/guides">Guides</a></li>
          
            <li><a href="/community/#contributing">Contribute</a></li>
          
            <li><a href="/faq">FAQ</a></li>
          
            <li><a href="/get-started">Get Started</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Contribute</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://twitter.com/quarkusio">Follow us</a></li>
          
            <li><a href="https://github.com/quarkusio">GitHub</a></li>
          
            <li><a href="/security">Security&nbsp;policy</a></li>
          
        </ul>
      </div>
    
      <div class="width-1-12 project-links">
        <span>Get Help</span>
        <ul class="footer-links width-1-12">
          
            <li><a href="https://groups.google.com/forum/#!forum/quarkus-dev">Forums</a></li>
          
            <li><a href="https://quarkusio.zulipchat.com">Chatroom</a></li>
          
        </ul>
      </div>
    

    
      <div class="width-3-12 more-links">
        <span>Quarkus is made of community projects</span>
        <ul class="footer-links">
          
            <li><a href="https://vertx.io/" target="_blank">Eclipse Vert.x</a></li>
          
            <li><a href="https://microprofile.io" target="_blank">Eclipse MicroProfile</a></li>
          
            <li><a href="https://hibernate.org" target="_blank">Hibernate</a></li>
          
            <li><a href="https://netty.io" target="_blank">Netty</a></li>
          
            <li><a href="https://resteasy.github.io" target="_blank">RESTEasy</a></li>
          
            <li><a href="https://camel.apache.org" target="_blank">Apache Camel</a></li>
          
            <li><a href="https://code.quarkus.io/" target="_blank">And many more...</a></li>
          
        </ul>
      </div>
    
  </div>
</div>
  <div class="content redhat-footer">
  <div class="grid-wrapper">
    <span class="licence">
      <i class="fab fa-creative-commons"></i><i class="fab fa-creative-commons-by"></i> <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC by 3.0</a> | <a href="https://www.redhat.com/en/about/privacy-policy">Privacy Policy</a>
    </span>
    <span class="redhat">
      Sponsored by
    </span>
    <span class="redhat-logo">
      <a href="https://www.redhat.com/" target="_blank"><img src="/assets/images/redhat_reversed.svg"></a>
    </span>
  </div>
</div>


  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js" integrity="sha384-8gBf6Y4YYq7Jx97PIqmTwLPin4hxIzQw5aDmUg/DDhul9fFpbbLcLh3nTIIDJKhx" crossorigin="anonymous"></script>
  <script type="text/javascript" src="/assets/javascript/mobile-nav.js"></script>
  <script type="text/javascript" src="/assets/javascript/scroll-down.js"></script>
  <script src="/assets/javascript/satellite.js" type="text/javascript"></script>
  <script src="https://quarkus.io/guides/javascript/config.js" type="text/javascript"></script>
  <script src="/assets/javascript/search-filter.js" type="text/javascript"></script>
  <script src="/assets/javascript/back-to-top.js" type="text/javascript"></script>
</body>

</html>
